home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2002 January / maximum-cd-2002-01.iso / Files / Mechwarrior 4 Mapping / MW4Editor.exe / content / ABLScripts / Bots / SlaughterBot.abl < prev    next >
Encoding:
Text File  |  2001-07-16  |  2.8 KB  |  108 lines

  1.  
  2. fsm SlaughterBot : integer;
  3.  
  4.  
  5. //------------------------------------------------------------------
  6.  
  7. // SlaughterBot:
  8. //   A difficult challenger, second only to the dreaded UberBot.
  9.  
  10. //------------------------------------------------------------------
  11.  
  12.  
  13. //------------------------------------------------------------------
  14. //     Constants
  15. //------------------------------------------------------------------
  16.  
  17.     const
  18.         #include_ <content\ABLScripts\mwconst.abi>
  19.  
  20. //------------------------------------------------------------------
  21. //     Types
  22. //------------------------------------------------------------------
  23.  
  24.     type
  25.         #include_ <content\ABLScripts\mwtype.abi>
  26.     
  27.  
  28. //------------------------------------------------------------------
  29. //     Variables
  30. //------------------------------------------------------------------
  31.  
  32.     var
  33.         static integer            attackRange;        // At what range do I start shooting?
  34.         static integer            withdrawRange;        // At what range do I withdraw?
  35.  
  36. //------------------------------------------------------------------
  37. //     Init: my initialization function
  38. //------------------------------------------------------------------
  39.  
  40. function Init;
  41.     code
  42.         // script-specific variables
  43.         attackRange        = 9999;
  44.         withdrawRange    = 9999;
  45.  
  46.         // driver settings
  47.         SetFiringDelay            (ME,0.0,1.0);
  48.         SetIgnoreFriendlyFire    (ME,true);
  49.         SetIsShotRadius            (ME,160);
  50.         SetEntropyMood            (ME,AGRESSIVE_START);
  51.         SetCurMood                (ME,AGRESSIVE_START);
  52.         SetSkillLevel            (ME,90,110,90);
  53.         SetAttackThrottle        (ME,95);
  54.         SetMinSpeed                (ME,50);
  55.                 
  56. endfunction;
  57.  
  58. //------------------------------------------------------------------
  59. //    StartState: my initial state
  60. //------------------------------------------------------------------
  61.  
  62. state StartState;
  63.  
  64.     code
  65.         trans WaitToAmbushState;
  66.  
  67. endstate;
  68.  
  69. //------------------------------------------------------------------
  70. //    WaitInAmbushState: wait for someone to come close enough to attack
  71. //------------------------------------------------------------------
  72.  
  73. state WaitToAmbushState;
  74.     code
  75.         if (Bot_FindEnemy(attackrange)) then
  76.             trans AttackState;
  77.         endif;
  78.  
  79.         OrderMoveLookOut;
  80. endstate;
  81.  
  82. //------------------------------------------------------------------
  83. //    AttackState: the ambush is over -- let's kick some ass!
  84. //------------------------------------------------------------------
  85.  
  86. state AttackState;
  87.     code
  88.         if (LeaveAttackState(withdrawRange)) then
  89.             trans WaitToAmbushState;
  90.         endif;
  91.  
  92.         OrderAttackTactic(TACTIC_FAST_CIRCLE,TRUE);
  93. endstate;
  94.  
  95. //------------------------------------------------------------------
  96. //    DeadState: OK, I kicked the bucket.
  97. //------------------------------------------------------------------
  98.  
  99. state DeadState;
  100.     code
  101.         orderDie;
  102.  
  103. endstate;
  104.  
  105.  
  106. endfsm.
  107.  
  108.